package csu.web.mypetstore.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;


@TableName(value ="product")
@Data
public class Product implements Serializable {
    /**
     * 
     */
    private String productid;

    /**
     * 
     */
    private String category;

    /**
     * 
     */
    private String name;

    /**
     * 
     */
    private String descn;
    @TableField(exist = false)
    private String image;
    @TableField(exist = false)
    private String description;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    public String getImage() {

        int index = this.descn.indexOf(">");

        return this.descn.substring(0, index+1);
    }
    public String getDescription() {

        int index = this.descn.indexOf(">");

        return this.descn.substring(index+1);
    }

    public String getProductid() {
        return productid;
    }

    public void setProductid(String productid) {
        this.productid = productid;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescn() {
        return descn;
    }

    public void setDescn(String descn) {
        this.descn = descn;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productid=").append(productid);
        sb.append(", category=").append(category);
        sb.append(", name=").append(name);
        sb.append(", descn=").append(descn);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }


}